<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script>
	<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
    <style type="text/css">
        div{
            width:100%;
        }
    </style>
    <title>发布文章</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
	<style>
		.n1{
			margin-left:100px;
		}
	</style>
	</head>
  <body>
	<div class="page-header" align="center">
		<h1>发布文章</h1>
	</div>
	<div class="container">
		<div class="jumbotron">
			<form class="form-horizontal" method="post"action="biao.php">
			<div class="form-group">
				<label for="title" class="col-sm-2 control-label">标题</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="title" placeholder="标题" name="title">
				</div>
			</div>
			<div class="form-group">
				<label for="author" class="col-sm-2 control-label">作者</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="author" placeholder="作者" name="author">
				</div>
			</div>
			<div class="form-group">
				<label for="high_name" class="col-sm-2 control-label">所属模型</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="high_name" placeholder="所属模型" name="high_name">
				</div>
			</div>
			<div class="form-group">
				<label for="middle_name" class="col-sm-2 control-label">栏目类别</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="middle_name" placeholder="栏目类别" name="middle_name">
				</div>
			</div>
			<div class="form-group">
				<label for="elementary_name" class="col-sm-2 control-label">栏目名称</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="elementary_name" placeholder="栏目名称" name="elementary_name">
				</div>
			</div>
			
			<div class="form-group">
			<!--ueditor编辑器开始-->
				<textarea id="editor" type="text/plain" style="width:1024px;height:500px;"></textarea>
			</div>
			<div class="form-group">
				<div class="col-sm-10">
				  <div align="right">
					<input type="submit" id="submit" name="submit" class="btn btn-success" value="提交">
				  </div>
				</div>
			</div>
		</form>
		</div>
	</div>
  </body>
  
			<script type="text/javascript">
				//实例化编辑器
				//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
				var ue = UE.getEditor('editor');

				function isFocus(e){
					alert(UE.getEditor('editor').isFocus());
					UE.dom.domUtils.preventDefault(e)
				}
				function setblur(e){
					UE.getEditor('editor').blur();
					UE.dom.domUtils.preventDefault(e)
				}
				function insertHtml() {
					var value = prompt('插入html代码', '');
					UE.getEditor('editor').execCommand('insertHtml', value)
				}
				function createEditor() {
					enableBtn();
					UE.getEditor('editor');
				}
				function getAllHtml() {
					alert(UE.getEditor('editor').getAllHtml())
				}
				function getContent() {
					var arr = [];
					arr.push("使用editor.getContent()方法可以获得编辑器的内容");
					arr.push("内容为：");
					arr.push(UE.getEditor('editor').getContent());
					alert(arr.join("\n"));
				}
				function getPlainTxt() {
					var arr = [];
					arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
					arr.push("内容为：");
					arr.push(UE.getEditor('editor').getPlainTxt());
					alert(arr.join('\n'))
				}
				function setContent(isAppendTo) {
					var arr = [];
					arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
					UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
					alert(arr.join("\n"));
				}
				function setDisabled() {
					UE.getEditor('editor').setDisabled('fullscreen');
					disableBtn("enable");
				}

				function setEnabled() {
					UE.getEditor('editor').setEnabled();
					enableBtn();
				}

				function getText() {
					//当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
					var range = UE.getEditor('editor').selection.getRange();
					range.select();
					var txt = UE.getEditor('editor').selection.getText();
					alert(txt)
				}

				function getContentTxt() {
					var arr = [];
					arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
					arr.push("编辑器的纯文本内容为：");
					arr.push(UE.getEditor('editor').getContentTxt());
					alert(arr.join("\n"));
				}
				function hasContent() {
					var arr = [];
					arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
					arr.push("判断结果为：");
					arr.push(UE.getEditor('editor').hasContents());
					alert(arr.join("\n"));
				}
				function setFocus() {
					UE.getEditor('editor').focus();
				}
				function deleteEditor() {
					disableBtn();
					UE.getEditor('editor').destroy();
				}
				function disableBtn(str) {
					var div = document.getElementById('btns');
					var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
					for (var i = 0, btn; btn = btns[i++];) {
						if (btn.id == str) {
							UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
						} else {
							btn.setAttribute("disabled", "true");
						}
					}
				}
				function enableBtn() {
					var div = document.getElementById('btns');
					var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
					for (var i = 0, btn; btn = btns[i++];) {
						UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
					}
				}

				function getLocalData () {
					alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
				}

				function clearLocalData () {
					UE.getEditor('editor').execCommand( "clearlocaldata" );
					alert("已清空草稿箱")
				}
			</script>
</html>